/**
 * 
 */
package com.gragra.applications;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
/**
 * @author Christoph Teichmann
 * 23.08.2013
 */
public class CountTags
{
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException
	{
		for(String s : args)
		{
			BufferedReader br = new BufferedReader(new FileReader(s));
			System.out.println(s);
			HashSet<String> set = new HashSet<String>();
			String line;
			while((line = br.readLine()) != null)
			{
				String[] parts = line.split("\\s+");
				for(String string : parts)
				{set.add(string.split("\\|")[1]);}
			}
			System.out.println(set.size());
			br.close();
		}
	}
}